<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <jsp:include page="/inc/head.jsp"/>
    <title>文章管理</title>
</head>
<body>
<jsp:include page="/inc/top.jsp"/>
<div class="container">
    <jsp:include page="inc.jsp"/>
    <table class="table table-bordered table-striped table-hover">
        <thead>
        <tr>
            <td>文章标识</td>
            <td>文章标题</td>
            <td>作者</td>
            <td>创建日期</td>
            <td>所属栏目</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${topics}" var="topic">
            <tr>
                <td>${topic.id}</td>
                <td>${topic.title}</td>
                <td>${topic.author}</td>
                <td>
                    <fmt:formatDate value="${topic.releaseDate}" pattern="yyyy年MM月dd日 HH:mm:ss"/>
                </td>
                <td>${topic.column.name}</td>
                <td>
                    <a href="javascript:confirmOp('<%=request.getContextPath()%>/admin/topic?m=delete&id=${topic.id}','删除文章对象不可逆，确定删除${topic.id}吗?')" class="btn btn-danger">删除</a>
                    <a href="<%=request.getContextPath()%>/admin/topic?m=update&id=${topic.id}" class="btn btn-warning">更新</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
</body>
</html>
